package com.结构型模型.I装饰者模式;

/**
 * @author zhangjiawen
 * @Date: 2022/6/13 17:43
 */
public class Bacon extends 配料类 {
    public Bacon(FastFood fastFood) {
        super(fastFood, 2, "培根");
    }

    @Override
    public float cost() {
        return getPrice()+getFastFood().cost();
    }

    @Override
    public String getDesc(){
        return super.getDesc()+"+"+getFastFood().getDesc();
    }
}
